Taran_logo_black
TILBLOGABOUTUSES

Today I learned about...
cool tech

Back to all tags

TIL about dotenv.org! You can use this to share and sync your .env files across machines/teammates. They also allow for the ability to encrypt your secrets and use them in your CI/CD pipelines.

The neat thing about this if someone leaves your company and you don’t have a fancy IT setup, you can just change the keys on the dotenv side of things and the keys the user has on their local machine will no longer be valid!

So I’ve been going pretty hard on my neovim settings and trying to really embrace the command line when doing any sort of development work. Today I learned about something called lazygit which is a terminal gui for git.

After being laid off from Productboard, I’ve been spending time thinking about how I want to continue with my career and what to do with my spare time. Of course landing a job is my priority, but during my time off, I want to devote time to learning skills and technology that I’ve never been able to make the time for in the past.

One thing I’ve always wanted to do (for the “by the way factor”) was setting up vim for my local development work. I devoted the entire day today to set up my neovim config; I’m pretty happy with it so far.

Here’s the config

So if you wanna figure out which commit in a repo caused an issue, git has a useful command to do just that.

git bisect

Read more here…

There’s been a lot of new developments in the space of package bundlers. From the OG Webpack to, Rollup to the new kid on the block esbuild each of them have their own unique set of features.

esbuild offers better build times as it is written in Go, which is compiled to JavaScript. The tradeoff here is that es5 isn’t supported (but that’s okay if you’re not supporting IE11). It’s pretty awesome but as it’s in active development and fairly new, it’s not as widely used as the other bundlers and therefore doesn’t have the rich plugin resource that somethings like webpack has.

However, you can leverage esbuild and plug it into a webpack config and via esbuild-loader I did this at work today and it helped with devserver startup times and greatly improved the production build times.

TIL that there is a cache control header for a shared cache. The s-max-age is similar to the max-age in that they both set a timer to invalidate a cache for a particular resource. The difference between the two is that the s-max-age applies to shared content and therefore applies to content on a CDN.

This is better in circumstances where we want to force an invalidation for a particular resource. This is not possible with max-age.

There’s a Netlify Identity Widget (that is framework agnostic) which can be leveraged to add some authentication to web apps deployed to Netlify.

There’s a limit of 1000 people but for a small e-commerce business that’s more than enough.

Here it is

While working through my functional programming course, I encountered a fun little leet code exercise. It’s fucking computer science so I’m not even surprised I had to solve a problem like this -.-

Anyway, here’s how the pascal triangle code will work in JS and in Scala

js-example
function run() {
  for (let row = 0; row <= 10; row++) {
    const rec = []
    for (let col = 0; col <= row; col++) {
      rec.push(pascal(col, row))
    }
    console.log(rec)
  }
}

const pascal = (col, row) => {
  if (col === 0 || row < 1 || col === row) return 1
  else return pascal(col, row - 1) + pascal(col - 1, row - 1)
}

run()
scala-example
def main(args: Array[String]): Unit = {
  println("Pascal's Triangle")
  for (row <- 0 to 10) {
    for (col <- 0 to row)
      print(s"${pascal(col, row)} ")
    println()
  }
}

/**
  * Exercise 1
  */
def pascal(c: Int, r: Int): Int = {
  // base case is if c = 0, just 1
  if (c == 0 || r < 2 || c == r) 1
  else pascal(c, r -1) + pascal(c - 1, r - 1)
}

Don’t be a sucka! TIL that you can get free HTTPS on your server thanks to a handy tool called Certbot.

Suck on that people who tried to charge me for HTTPS.

Long story short, t tiers of ec2 instances are spotty and unreliable; stick to using m series at the very least

Single sign-on (SSO) is a property of access control of multiple related, yet indepdent records. Thanks to this property, users can log in with a single ID and password to gain access to any of several related systems.

If you’re working in a corporate setting, this is how you’re able to seamlessly switch between applications (maybe in the browser) and not have to log in despite the fact that all these systems have some sort of authentication and authorization piece associated with them.

Read more about it here!

I’ll be honest, up until today, I never really cared about character encodings and didn’t ever bother to learn anything about them… what a huge mistake! Character encodings are the unsung heroes that allow us to display languages (besides English) reliabely on computer systems.

The gist of UTF-8 is that it is an encoding that allows us to take Unicode code and map said codes to meaningful linguinstic representations. Codes that are between 0 and 127 occupy 8 bits — a single byte — and then any codes above this upper bound can use up to 6 bytes. The beauty of this system is that strings encoded in UTF-8 look exactly the same as strings encoded in ASCII. Americans are chilling and don’t need to worry about squat, while the rest of the world has to “jump through hoops” to make sure that they’re alphhabet will work across computer systems.

Read more here

Buddy works allows us to create pipelines for our projects! Similar to how envoyer and deploybot works!
It comes with a bunch of prebuilt recipes for when you try to set up your actions. We’re using it to do deployments to a project site after PRs are merged and firing off notifications on slack!

Check it out

Blog post about: My recap of what I learned with Jem Young regarding WebAssembly